Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODArbitrator


TransferFocus

The TransferFocus method directly transfers a focus from its current owner to another.

void TransferFocus (in ODTypeToken focus, 
                    in ODFrame transferringFrame, 
                    in ODFrame newOwner);
focus
A tokenized string representing the focus type to be transferred, expressed as a 32-bit value.
transferringFrame
A reference to a frame that is transferring ownership of the focus. This frame need not be the current owner.
newOwner
A reference to a frame that is to be the new focus owner.
DISCUSSION
The focus parameter must be the tokenized form of one of the focus constants (kODClipboardFocus, kODKeyFocus, kODMenuFocus, kODModalFocus, kODMouseFocus, kODScrollingFocus, or kODSelectionFocus) or the tokenized form of a part-specific focus type. You can call the session object's Tokenize method to obtain a token corresponding to one of these constants.

Your part can call this method, instead of methods that relinquish a focus, to restore ownership to a previous owner. For example, when a part requests the modal focus, as it does when displaying a modal dialog box, that part should save the previous owner of the modal focus, and transfer ownership back to the previous owner when the dialog box is dismissed. This technique may be necessary if modal dialog boxes can be nested.

This method calls the new owner's FocusAcquired method if the new owner is not the transferring frame. If the previous owner is not the transferring frame, OpenDoc also calls the previous owner's FocusLost method.

SEE ALSO
The ODFocusType type (page 889).
The ODTypeToken type (page 877).
The ODArbitrator::TransferFocusSet method (page 57).
The ODPart::FocusAcquired method (page 517).
The ODPart::FocusLost method (page 518).
The ODSession::Tokenize method (page 622).
"Transferring Focus Without Negotiation" on page 209 in OpenDoc Programmer's Guide.
"Handling a Simple Modal Dialog Box" on page 233 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help